import gconf

class NetlogMusicConf (object):
	def __init__(self):
		self.gconf_keys = { 
			'domain': '/apps/rhythmbox/plugins/netlog-music/domain',
			'username': '/apps/rhythmbox/plugins/netlog-music/username',
			'password':'/apps/rhythmbox/plugins/netlog-music/password',
			'autologin':'/apps/rhythmbox/plugins/netlog-music/autologin'
			}
		self.gconf = gconf.client_get_default()
		if self.get("domain") == "":
			self.set("domain","de.api.netlog.com")
		
	def get(self, key):
		val = self.gconf.get_string(self.gconf_keys[key])
		if val:
			return val
		else:
			return ""
			
	def get_bool(self, key):
		return self.gconf.get_bool(self.gconf_keys[key])
	
	def set_bool(self, key, val):
		self.gconf.set_bool(self.gconf_keys[key], val)
	
	def set(self, key, val):
		self.gconf.set_string(self.gconf_keys[key], val)			
